package com.lg.system.wxconfig.service.impl;

import com.lg.system.wxconfig.entity.WxConfig;
import com.lg.system.wxconfig.dao.WxConfigDao;
import com.lg.system.wxconfig.service.WxConfigService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import java.util.List;
import java.util.Date;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dl
 * @since 2018-04-03
 */
@Transactional
@Service
public class WxConfigServiceImpl extends ServiceImpl<WxConfigDao, WxConfig> implements WxConfigService {

	
	public boolean save( WxConfig wxConfig) {
		return super.insert(wxConfig);
	}

	@Override
	public boolean update(WxConfig wxConfig) {
		return super.updateById(wxConfig);
	}
	
	
	@Override
	public boolean deleteById(Long id) {
		return super.deleteById(id);
	}

	@Override
	public boolean deleteByIds(List<Long> ids) {
		if(null==ids||ids.isEmpty()){
			return false;
		}
		return super.deleteBatchIds(ids);
	}

	@Override
	public WxConfig selectConfig() {
		EntityWrapper<WxConfig>  wrapper = new EntityWrapper<WxConfig>();
		wrapper.eq("open", 1);
		return selectOne(wrapper);
	}

}
